<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<%@page errorPage = "error.jsp" %>
 <jsp:useBean id="UserBean" class="user.UserBean" scope="session" />
 	<jsp:setProperty name="UserBean" property="*"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<c:if test="${!UserBean.isLoggedIn() || UserBean.isInactive()}">
	<c:redirect url="error.jsp"/>
</c:if>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Administration</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/Resources/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/Resources/Styles/back.css">
    <script src="${pageContext.request.contextPath}/Resources/Scripts/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/Resources/Scripts/script.js"></script>
    <script src="${pageContext.request.contextPath}/Resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
 <form action="UserController" name="appform" method="post" id="target" class="form-horizontal">
    <div class="item-active">
        <div class="container">
            <div class="panel active">
                <ul class="nav nav-tabs nav-pills" id="myTab">
                    <li class=""> <a href="cameras" data-toggle="tab">Cameras</a>
                  	<c:if test="${UserBean.isAdmin()}">       
	                    <li class="active dropdown">
	                        <a class="dropdown-toggle" data-toggle="dropdown">Management<span class="caret"></span></a>
	                        <ul class="dropdown-menu" role="menu">
	                            <li><a class="addUser" href="#addUser" data-toggle="tab">Add New user</a></li>
	                            <li><a class="showUsers" href="ShowUsers" data-toggle="tab">Show User List</a></li>
	                            <li><a class="addCamera" href="#addCamera" data-toggle="tab">Add New Camera</a></li>
	                        </ul>
	                    </li>
                    </c:if>
                    <li class=""> <a href="#" data-toggle="tab">About</a>
                    <li class="pull-right"> <a class="logout" href="#" data-toggle="tab">Logout</a>
                </ul>
                <br>
                <div class="tab-content">
                		<c:if test="${UserBean.isAdmin()}">
                        <div class="row">
                            <fieldset>
                                <div class="form-group">
                                    <label for="loginname" class="col-lg-3 control-label">Loginname:</label>
                                    <div class="col-md-6">
                                        <input type="text" required="" class="form-control input-md" placeholder="Loginname" name="username" id="loginname">
                                        <span class="help-block">Enter loginname here</span>
                                    </div>
                                </div>
                                <div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Text Input" data-trigger="manual" data-html="true">
                                    <!-- Text input-->
                                    <div class="form-group">
                                        <label for="username" class="col-lg-3 control-label">Username:</label>
                                        <div class="col-md-6">
                                            <input type="text" required="" class="form-control input-md" placeholder="Username" name="fullname" id="username">
                                            <span class="help-block">Enter username here</span>
                                        </div>
                                    </div>
                                </div><div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Text Input" data-trigger="manual" data-html="true">
                                    <!-- Text input-->
                                    <div class="form-group">
                                        <label for="location" class="col-lg-3 control-label">Location:</label>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control input-md" placeholder="Location" name="location" id="location">
                                            <span class="help-block">Enter user location here</span>
                                        </div>
                                    </div>
                                </div><div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Password Input" data-trigger="manual" data-html="true">
                                    <!-- Password input-->
                                    <div class="form-group">
                                        <label for="password" class="col-lg-3 control-label">Password:</label>
                                        <div class="col-md-6">
                                            <input type="password" required="" class="form-control input-md" placeholder="Password" name="password" id="password">
                                            <span class="help-block">Enter user password here</span>
                                        </div>
                                    </div>
                                </div><div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Password Input" data-trigger="manual" data-html="true">
                                    <!-- Password input-->
                                    <div class="form-group">
                                        <label for="confPassword" class="col-lg-3 control-label">Confirm password:</label>
                                        <div class="col-md-6">
                                            <input type="password" required="" class="form-control input-md" placeholder="Confirm password" name="confPassword" id="confPassword">
                                            <span class="help-block">Confirm password here</span>
                                        </div>
                                    </div>
                                </div><div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Select Basic" data-trigger="manual" data-html="true">
                                    <!-- Select Basic -->
                                    <div class="form-group">
                                        <label for="userGroup" class="col-lg-3 control-label">User group:</label>
                                        <div class="col-md-6">
                                            <select class="form-control" name="admin" id="userGroup">
                                                <option value="1">User</option>
                                                <option value="0">Admin</option>
                                            </select>
                                        </div>
                                    </div>
                                </div><div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Select Basic" data-trigger="manual" data-html="true">
                                    <!-- Select Basic -->
                                    <div class="form-group">
                                        <label for="active" class="col-lg-3 control-label">Active:</label>
                                        <div class="col-md-6">
                                            <select class="form-control" name="inactive" id="active">
                                                <option value="1">Yes</option>
                                                <option value="0">No</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Button" data-trigger="manual" data-html="true">
                                    <div class="form-group">
                                        <div class="col-md-6">
                                            <label for="brnOk" class="col-lg-3 control-label"></label>
                                            <button name="btnAdduser" value="OK" type="submit" class="btn btn-primary" style="width: 8em">OK</button>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>                    
                        </div> 
                        </c:if>    
                    </div>
                </div>
            </div>
        </div>
     </form>
</body>
</html>
